/**
 * @Author MrsGuo
 * version 1.0
 * @Date 2023-07-27 13:20
 */
package com.cl.erp_2301.conf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private HandlerInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                //拦截所有
                .addPathPatterns("/**")
                //添加允许通过
                .excludePathPatterns("/login.html","/v2/login","/**/*.js","/**/*.css","/**/font/**");

    }
}
